/**
 * Created by IntelliJ IDEA.
 * User: Taras_Brzezinsky
 * Date: 8/29/11
 * Time: 6:02 PM
 * To change this template use File | Settings | File Templates.
 */

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.StringTokenizer;

public class TaskA extends Thread {
    public TaskA() {
        this.input = new BufferedReader(new InputStreamReader(System.in));
        this.output = new PrintWriter(System.out);
        this.setPriority(Thread.MAX_PRIORITY);
    }

    static class State  implements  Comparable<State>{
        int numSeven, numFour;
        public State(int numFour, int numSeven) {
            this.numFour = numFour;
            this.numSeven = numSeven;
        }

        public int compareTo(TaskA.State o) {
            int sum = numSeven + numFour, otherSum = o.numFour + o.numSeven;
            if (sum == otherSum) {
                return o.numFour - this.numFour;
            } else {
                return sum - otherSum;
            }
        }
    }

    private void solve() throws Throwable {
        int n = nextInt();
        ArrayList<State> states = new ArrayList<State>();
        for (int four = 0; four * 4 <= n; ++four) {
            if ((n - four * 4) % 7 == 0) {
                states.add(new State(four, (n - four * 4) / 7));
            }
        }
        Collections.sort(states);
        if (states.isEmpty()) {
            output.println(-1);
        } else {
            State current = states.get(0);
            for (int i = 0; i < current.numFour; ++i) {
                output.print(4);
            }
            for (int i = 0; i < current.numSeven; ++i) {
                output.print(7);
            }
        }



    }

    public void run() {
        try {
            solve();
        } catch (Throwable e) {
            System.err.println(e.getMessage());
            e.printStackTrace();
            System.exit(666);
        } finally {
            output.flush();
            output.close();
        }
    }

    public static void main(String[] args) {
        new TaskA().start();
    }

    private int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    private long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    private double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    private String nextToken() throws IOException {
        while (tokens == null || !tokens.hasMoreTokens()) {
            tokens = new StringTokenizer(input.readLine());
        }
        return tokens.nextToken();
    }

    private BufferedReader input;
    private PrintWriter output;
    private StringTokenizer tokens = null;
}
